package gerneric

object GenericDemo01 {
  def main(args: Array[String]): Unit = {
    val intMessage = new IntMessage[Int](10)
    println(intMessage)
    val strMessage = new StrMessage[String]("hello")
    println(strMessage)
  }

}

abstract class Message[T](s: T) {
  def get = s
}

class IntMessage[Int](v: Int) extends Message(v)

class StrMessage[String](v: String) extends Message(v)
